From bytecode to JavaScript: the Js_of_ocaml compiler

نویسندگان

  • Jérôme Vouillon
  • Vincent Balat
چکیده

We present the design and implementation of a compiler from OCaml bytecode to JavaScript. The compiler first translate the bytecode into an SSA intermediate representation on which optimizations are performed, before generating JavaScript. We believe that taking bytecode as input instead of a high-level language is a sensible choice. Virtual machines provide a very stable API. Such a compiler is thus easy to maintain. It is also convenient to use: it can just be added to an existing installation of the development tools. Already compiled libraries can be used directly, with no need to reinstall anything. Finally, some virtual machines are the target of several languages. A bytecode to JavaScript compiler would make it possible to retarget all these languages to Web browsers at once. Copyright c © 0000 John Wiley & Sons, Ltd.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Information Flow Control in WebKit's JavaScript Bytecode

Websites today routinely combine JavaScript from multiple sources, both trusted and untrusted. Hence, JavaScript security is of paramount importance. A specific interesting problem is information flow control (IFC) for JavaScript. In this paper, we develop, formalize and implement a dynamic IFC mechanism for the JavaScript engine of a production Web browser (specifically, Safari’s WebKit engine...

متن کامل

High Performance Client-Side Web Programming with SPOC and Js of ocaml

We present WebSpoc, an OCaml GPGPU library targeting web applications that is built upon SPOC and js of ocaml. SPOC is an OCaml GPGPU library focusing on abstracting memory transfers, handling GPGPU computations and offering easy portability. Js of ocaml is the OCaml bytecode to JavaScript compiler. Thus, WebSpoc provides high performance computations from the web browser while benefitting from...

متن کامل

Transparent Object Proxies for JavaScript Technical Report

Proxies are the swiss army knives of object adaptation. They introduce a level of indirection to intercept select operations on a target object and divert them as method calls to a handler. Proxies have many uses like implementing access control, enforcing contracts, virtualizing resources. One important question in the design of a proxy API is whether a proxy object should inherit the identity...

متن کامل

Transparent object proxies for javascript

Proxies are the swiss army knives of object adaptation. They introduce a level of indirection to intercept select operations on a target object and divert them as method calls to a handler. Proxies have many uses like implementing access control, enforcing contracts, virtualizing resources. One important question in the design of a proxy API is whether a proxy object should inherit the identity...

متن کامل

An annotation-aware Java virtual machine implementation

The Java bytecode language lacks expressiveness for traditional compiler optimizations, making this portable, secure software distribution format ine cient as a program representation for high performance. This ine ciency results from the underlying stack model, as well as the fact that many bytecode operations intrinsically include sub-operations (e.g., iaload includes the address computation,...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • Softw., Pract. Exper.

دوره 44  شماره 

صفحات  -

تاریخ انتشار 2014